package com.mobilnaElka.activities;

import java.io.File;

import android.app.TabActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TabHost;

import com.mobilnaElka.AppConsts;

public class MainActivity extends TabActivity  {
	
	TabHost tabHost;	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab);
        tabHost = (TabHost)findViewById(android.R.id.tabhost);
        ApplicationTabs.setMyTabs(tabHost, this);
        initElkaFiles();
        
    }
	private static boolean initElkaFiles() {
		
		boolean ret = true;

	    File file = new File(AppConsts.MAIN_DIR, AppConsts.APP_NAME);
	    if (!file.exists()) {
	        if (!file.mkdirs()) {
	            Log.e(AppConsts.TAGNAME, "Problem creating Image folder");
	            ret = false;
	        }
	    }
	    
	    file = new File(AppConsts.MOBILNA_ELKA_DIR, AppConsts.APP_STUFF_NAME);
	    if (!file.exists()) {
	        if (!file.mkdirs()) {
	            Log.e(AppConsts.TAGNAME, "Problem creating Image folder");
	            ret = false;
	        }
	    }
	    
	    file = new File(AppConsts.STUFFS_DIR, AppConsts.APP_IMAGES_NAME);
	    if (!file.exists()) {
	        if (!file.mkdirs()) {
	            Log.e(AppConsts.TAGNAME, "Problem creating Image folder");
	            ret = false;
	        }
	    }
	    return ret;
		
	}      
}
